package com.example.harmonyos_orm.database;

import com.example.harmonyos_orm.ResourceTable;
import com.example.harmonyos_orm.viewholder.PhotoViewHolder;
import com.zhushenwudi.hmutils.adapter.Model;
import ohos.data.orm.OrmObject;
import ohos.data.orm.annotation.Entity;
import ohos.data.orm.annotation.PrimaryKey;

@Entity(tableName = "PhotoTable")
public class PhotoItem extends OrmObject implements Model {

    public PhotoItem() {
    }

    public PhotoItem(int path) {
        this.path = path;
    }

    @PrimaryKey(autoGenerate = true)
    private Integer id;
    private int path;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getPath() {
        return path;
    }

    public void setPath(int path) {
        this.path = path;
    }

    @Override
    public int getResource(int position) {
        return ResourceTable.Layout_item_main;
    }

    @Override
    public Class getHolderClass(int position) {
        return PhotoViewHolder.class;
    }
}
